package com.ruoyi.Packets.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.Packets.mapper.PacketsMapper;
import com.ruoyi.Packets.domain.Packets;
import com.ruoyi.Packets.service.IPacketsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 红包 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-30
 */
@Service
public class PacketsServiceImpl implements IPacketsService 
{
	@Autowired
	private PacketsMapper packetsMapper;

	/**
     * 查询红包信息
     * 
     * @param id 红包ID
     * @return 红包信息
     */
    @Override
	public Packets selectPacketsById(Integer id)
	{
	    return packetsMapper.selectPacketsById(id);
	}
	
	/**
     * 查询红包列表
     * 
     * @param packets 红包信息
     * @return 红包集合
     */
	@Override
	public List<Packets> selectPacketsList(Packets packets)
	{
	    return packetsMapper.selectPacketsList(packets);
	}
	
    /**
     * 新增红包
     * 
     * @param packets 红包信息
     * @return 结果
     */
	@Override
	public int insertPackets(Packets packets)
	{
	    return packetsMapper.insertPackets(packets);
	}
	
	/**
     * 修改红包
     * 
     * @param packets 红包信息
     * @return 结果
     */
	@Override
	public int updatePackets(Packets packets)
	{
	    return packetsMapper.updatePackets(packets);
	}

	/**
     * 删除红包对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deletePacketsByIds(String ids)
	{
		return packetsMapper.deletePacketsByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Packets> selectPacketsListForShow(Packets packets) {
		return packetsMapper.selectPacketsListForShow(packets);
	}
	
}
